v1=reshape(d1,15,3223,15);
v2=reshape(d2,15,277,15);

jointsp=[0,1;3,6;2,3;2,6;2,9;2,12;3,4;6,7;4,5;7,8;9,12;9,10;12,13;10,11;13,14];
joints=jointsp+1;
joint{1}='head';
joint{2}='neck';
joint{3}='torso';
joint{4}='left shoulder';
joint{5}='left elbow';
joint{6}='left hand';
joint{7}='right shoulder';
joint{8}='right elbow';
joint{9}='right hand';
joint{10}='left hip';
joint{11}='left knee';
joint{12}='left foot';
joint{13}='right hip';
joint{14}='right knee';
joint{15}='right foot';


for i=1:15
    for j=(i+1):15
        h1=figure('visible','off');
        hist(v1(i,:,j),300)
        xlabel('Distance');
        ylabel('Frequency');
        title({['Histograma - data set ',num2str(1)];[joint{i},' - ',joint{j}]});
        print(h1, '-dpng', strcat('hist_',num2str(1),'_',joint{i},'_',joint{j},'.png'));
        h2=figure('visible','off');
        hist(v2(i,:,j),30)
        title({['Histograma - data set ',num2str(2)];[joint{i},' - ',joint{j}]});
        xlabel('Distance');
        ylabel('Frequency');
        print(h2, '-dpng', strcat('hist_',num2str(2),'_',joint{i},'_',joint{j},'.png'));
    end
end